package com.yugao.fintech.antelope.base.mq.vender.rabbitmq;

import com.yugao.fintech.antelope.base.model.module.mq.AbstractMQ;
import com.yugao.fintech.antelope.base.mq.vender.IMQSender;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class RabbitmqSender implements IMQSender {
    @Autowired
    private RabbitTemplate rabbitTemplate;

    @Override
    public void send(AbstractMQ mqModel) {
//        if(mqModel.getMQType() == MQSendTypeEnum.QUEUE) {
//            rabbitTemplate.convertAndSend(MsgPushMqCons.MSG_PUSH_DELAYED_EXCHANGE, "", mqModel.toMessage());
//        }
    }

    @Override
    public void send(AbstractMQ mqModel, int delay) {
//        if(mqModel.getMQType() == MQSendTypeEnum.QUEUE) {
//            rabbitTemplate.convertAndSend(MsgPushMqCons.MSG_PUSH_DELAYED_EXCHANGE, "", mqModel.toMessage(), correlationData -> {
//                correlationData.getMessageProperties().setDelay(delay * 1000);
//                return correlationData;
//            });
//        }

    }
}
